class Solution(object):
    def arrayPairSum(self, nums):
        """
        :type nums: List[int]
        :rtype: int
        """
        nums.sort()
        return sum(nums[::2])

data = Solution()
nums = [6, 2, 6, 5, 1, 2]
print(data.arrayPairSum(nums))
